package web.ling.por

import org.apache.commons.codec.binary.Base64
import org.apache.commons.codec.digest.DigestUtils

abstract class User {

    String name

    Byte[] avatar
    String avatarType

    String email
    String password
    String paypalMail

    static constraints = {
        name size: 2..50, blank: false, nullable: false
        avatar nullable: true, maxSize: (Integer) 1024*1024/4 //250KB
        avatarType nullable: true, inList: ['image/png', 'image/jpeg', 'image/gif']
        email email: true, blank: false, nullable: false, unique: true
        password blank: false, nullable: false
        paypalMail nullable: true
    }

}
